import request from "./request";
import apiConfig from "./config";
import { getApiPath } from "./util";
import { getFormData } from "../utils";
export const loginApi = function (data) {
  const {
    login: { path, method },
  } = apiConfig;
  return request({
    method,
    url: getApiPath(path),
    data: getFormData(data),
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
};

export const whoamiApi = function (data) {
  const {
    whoami: { path, method },
  } = apiConfig;
  return request({
    method,
    url: getApiPath(path),
    data,
  });
};
